﻿// ***********************************************************************
// Assembly         : OccExample.Commands
// Author           : TianTeng
// Created          : 2024/4/22 16:35:00
//
// Last Modified By : TianTeng
// Last Modified On : 2024/4/22 16:35:00
// ***********************************************************************
// <copyright file="DocCloseCmd.cs" company="">
//     Copyright ©  2024
// </copyright>
// <summary></summary>
// ***********************************************************************
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tx;

namespace OccExample.Commands
{
    /// <summary>
    /// Class DocCloseCmd.
    /// </summary>
    /// <seealso cref="IExtendCommand" />
    [DocOpenedCmdEnable]
	public class DocCloseCmd : IExtendCommand
    {
        /// <summary>
        /// Executes the specified command data.
        /// </summary>
        /// <param name="cmdData">The command data.</param>
        /// <param name="message">The message.</param>
        /// <returns>CmdResult.</returns>
        public CmdResult Execute(ExtendCmdData cmdData, ref string message)
        {
            var mainWindow = cmdData.MainWindow as MainWindow;
            mainWindow.DocClose();
            return CmdResult.Succeed;
        }
    }
}
